/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.machineryrental.restclient.services;

import cz.muni.fi.pa165.machineryrental.dto.CustomerDTO;
import java.util.List;

/**
 *
 * @author David Katuscak, 359273
 */
public interface CustomerRestService {

    /**
     * Returns customer with given id
     *
     * @param id Id of customer
     * @return Customer with id
     */
    public CustomerDTO getById(long id);

    /**
     * Returns all customers
     *
     * @return List of all customers in the system
     */
    public List<CustomerDTO> findAll();

    /**
     * Creates given customer in database.
     *
     * @param customer CustomerDTO to save
     */
    public void create(CustomerDTO customer);

    /**
     * Updates given customer in database.
     *
     * @param customer CustomerDTO to update
     */
    public void update(CustomerDTO customer);

    /**
     * Removes given customer from database.
     *
     * @param id id of the Customer to remove
     */
    public void remove(long id);

    /**
     * Returns customer with given lastName.
     *
     * @param lastName lastName.
     * @return List of CustomerDTO of customers that match searching lastname
     */
    public List<CustomerDTO> findByLastName(String lastName);

    /**
     * Returns customer with given email.
     *
     * @param email email.
     * @return customerDTO of customer with given email
     */
    public CustomerDTO findByEmail(String email);

    /**
     * Returns customer with given companyNumber.
     *
     * @param companyNumber companyNumber.
     * @return customerDTO of customer with given companyNumber
     */
    public CustomerDTO findByCompanyNumber(String companyNumber);
    
    
    /**
     * Returns if given email is unique among customers
     * @param email Am email of customer
     * @return true if email is unique, false otherwise
     */
    public boolean isEmailUnique(String email);
    
    /**
     * Returns if given VAT number is unique among BUSINESS customers
     * @param vat VAT number of customer
     * @return true if VAT number is unique, false otherwise
     */
    public boolean isVATUnique(String vat);
    
    /**
     * Returns if given company number is unique among BUSINESS customers
     * @param companyNumber Company number of customer
     * @return true if company number is unique, false otherwise
     */
    public boolean isCompanyNumberUnique(String companyNumber);
}
